import 'dart:convert';

class SiteInfo {
  final int tagCount;
  final int postsCount;
  final int categoryCount;
  final int commentCount;

  SiteInfo({
    required this.tagCount,
    required this.postsCount,
    required this.categoryCount,
    required this.commentCount,
  });

  factory SiteInfo.fromRawJson(String str) =>
      SiteInfo.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory SiteInfo.fromJson(Map<String, dynamic> json) => SiteInfo(
        tagCount: json["tagCount"],
        postsCount: json["postsCount"],
        categoryCount: json["categoryCount"],
        commentCount: json["commentCount"],
      );

  Map<String, dynamic> toJson() => {
        "tagCount": tagCount,
        "postsCount": postsCount,
        "categoryCount": categoryCount,
        "commentCount": commentCount,
      };
  @override
  String toString() {
    return 'SiteInfo{tagCount: $tagCount, postsCount: $postsCount, categoryCount: $categoryCount, commentCount: $commentCount}';
  }
}
